#include "abstractpoll.h"
#include <sys/epoll.h>

namespace SocketLib
{

class SocketFD;

class EpollPoll : public SocketFDPoll
{
    const static int MAXEVENTNUM = 1024;

public:
    EpollPoll();
    void                doPoll(long aTimeout = 1000);
    void                addSocketFD(SocketFD* pSocketFD);        //添加一个SocketFD到轮询列表
    void                delSocketFD(SocketFD* pSocketFD);        //从轮询列表中删除参数指定的SocketFD

private:
    void                onPollError();
    void                motifyFdEvent(SocketFD*    pSocketFD, uint32_t);

private:
    epoll_event         m_tempEvent;
    epoll_event         m_eventList[MAXEVENTNUM];
    int                 m_epollFD;
};

}
